package com.dmxh.controller;

import com.dmxh.result.Result;
import com.dmxh.service.UserService;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/back")
public class getBackController {

    @Autowired
    private UserService userService;

    //    修改当前用户的密码   需要获取当前用户输入的  然后覆盖他的密码  并且通过邮箱返回
    @PutMapping("/getBack")
    public Result getBack(@RequestParam String userName) {
        return Result.ok().setData(userService.queryUserByPhoneAndUpdate(userName));
    }
}
